#ifndef DATABASE_FIELD
#define DATABASE_FIELD

#include <QObject>
#include <QVariantMap>

class DatabaseField : public QObject
{
public:
    ~DatabaseField() {}

    virtual void setEditable(QWidget *delegate, bool editable) = 0;
    virtual QVariant data(QWidget *delegate) const = 0;
    virtual void setData(QWidget *delegate, const QVariant &data) = 0;

    virtual QWidget *createDelegate(const QVariantMap &properties = QVariantMap()) = 0;
    virtual void connectToDataChange(QWidget *delegate, QObject *reciever, const char *slot)
    {
        Q_UNUSED(delegate)
        Q_UNUSED(reciever)
        Q_UNUSED(slot)
    }

public slots:
    virtual void clear(QWidget *delegate) = 0;
};

Q_DECLARE_INTERFACE(DatabaseField, "rlab.acs.database_field")

#endif //DATABASE_FIELD
